# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1betaAdvancedCompleteQueryResponse do
  @moduledoc """
  Response message for CompletionService.AdvancedCompleteQuery method.

  ## Attributes

  *   `contentSuggestions` (*type:* `list(GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1betaAdvancedCompleteQueryResponseContentSuggestion.t)`, *default:* `nil`) - Results of the matched content suggestions. The result list is ordered and the first result is the top suggestion.
  *   `peopleSuggestions` (*type:* `list(GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1betaAdvancedCompleteQueryResponsePersonSuggestion.t)`, *default:* `nil`) - Results of the matched people suggestions. The result list is ordered and the first result is the top suggestion.
  *   `querySuggestions` (*type:* `list(GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1betaAdvancedCompleteQueryResponseQuerySuggestion.t)`, *default:* `nil`) - Results of the matched query suggestions. The result list is ordered and the first result is a top suggestion.
  *   `recentSearchSuggestions` (*type:* `list(GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1betaAdvancedCompleteQueryResponseRecentSearchSuggestion.t)`, *default:* `nil`) - Results of the matched "recent search" suggestions. The result list is ordered and the first result is the top suggestion.
  *   `tailMatchTriggered` (*type:* `boolean()`, *default:* `nil`) - True if the returned suggestions are all tail suggestions. For tail matching to be triggered, include_tail_suggestions in the request must be true and there must be no suggestions that match the full query.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :contentSuggestions =>
            list(
              GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1betaAdvancedCompleteQueryResponseContentSuggestion.t()
            )
            | nil,
          :peopleSuggestions =>
            list(
              GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1betaAdvancedCompleteQueryResponsePersonSuggestion.t()
            )
            | nil,
          :querySuggestions =>
            list(
              GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1betaAdvancedCompleteQueryResponseQuerySuggestion.t()
            )
            | nil,
          :recentSearchSuggestions =>
            list(
              GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1betaAdvancedCompleteQueryResponseRecentSearchSuggestion.t()
            )
            | nil,
          :tailMatchTriggered => boolean() | nil
        }

  field(:contentSuggestions,
    as:
      GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1betaAdvancedCompleteQueryResponseContentSuggestion,
    type: :list
  )

  field(:peopleSuggestions,
    as:
      GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1betaAdvancedCompleteQueryResponsePersonSuggestion,
    type: :list
  )

  field(:querySuggestions,
    as:
      GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1betaAdvancedCompleteQueryResponseQuerySuggestion,
    type: :list
  )

  field(:recentSearchSuggestions,
    as:
      GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1betaAdvancedCompleteQueryResponseRecentSearchSuggestion,
    type: :list
  )

  field(:tailMatchTriggered)
end

defimpl Poison.Decoder,
  for:
    GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1betaAdvancedCompleteQueryResponse do
  def decode(value, options) do
    GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1betaAdvancedCompleteQueryResponse.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for:
    GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1betaAdvancedCompleteQueryResponse do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
